import Vue from "vue";
import VueRouter from "vue-router";

Vue.use(VueRouter);

const routes = [
  {
    //定义动态路由
    path: "/news/:id",
    name: "news",
    component: () => import("../pages/details/details.vue"),
    props:true
  },
  {
    path:"/home",
    name:"home",
    component: () => import("../pages/home/home.vue")
  }
];

const router = new VueRouter({
  routes,
});

export default router;
